package se.nikmel.AnDisper;

import se.nikmel.AnDisper.UI.UI_ServerConfig_Controller;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

public class ServerSetupActivity extends Activity {
	
	@SuppressWarnings("unused")
	private static final String TAG = "ServerSetupActivity"; // Logging tag
	// UI Elements
	private UI_ServerConfig_Controller m_uiServerSetup;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// 2. Build UI
		this.requestWindowFeature(Window.FEATURE_PROGRESS);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		m_uiServerSetup = new UI_ServerConfig_Controller(this);
		// 3. Receive intent
		//Intent intMessage = getIntent();
		//String sInitIP = intMessage.getStringExtra("IP");
		m_uiServerSetup.setSeenServers(MainActivity.m_mapSeenServers);
		
		// 4. Set content
		this.setContentView(m_uiServerSetup.getView());		
	}
	
	// Called from UI when it's done...
	public void postResult(String p_sIP){
		Intent intResult = getIntent();
		intResult.putExtra("IP", p_sIP);
		setResult(RESULT_OK, intResult);
		finish();
	}

}
